package com.learning.security.dal.mysql;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.learning.security.dal.dataobject.AdminRoleRightDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 * 角色和权限点关联表 Mapper 接口
 * </p>
 *
 * @author xxx
 * @since 2024-10-04
 */
@Mapper
public interface AdminRoleRightMapper extends BaseMapper<AdminRoleRightDO> {

    default List<AdminRoleRightDO> getRoleRightByRightId(Long rightId) {
        LambdaQueryWrapper<AdminRoleRightDO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(AdminRoleRightDO::getRightId, rightId);
        return selectList(queryWrapper);
    }
}
